import { createRouter, createWebHashHistory,createWebHistory } from 'vue-router'
import routes from '~pages'

// // console.log('routes', routes)
// import MyPanel from '@/pages/vue3Advance/comp/MyPanel.vue'


// routes.unshift({
//   path: '/aaaaaaaa',
//   component: MyPanel
// })

routes.unshift({
  path: '/',
  redirect: '/vue3Advance/compToHtml'
})


const router = createRouter({
  // history: createWebHistory(import.meta.env.BASE_URL),
  history: createWebHashHistory(),
  // history: createWebHistory(),
  routes,
})

// 获取路由地址
console.log(router.getRoutes())

export function loadRouter (app) {
  app.use(router)
}

export default loadRouter
